﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace Portal
{
    public interface IService<T>
    {
        /// <summary>
        /// 获取表IQueryable 
        /// </summary>
        /// <returns></returns>
        IQueryable<T> Get();
        /// <summary>
        /// 根据条件获取表IQueryable 
        /// </summary>
        /// <returns></returns>
        IQueryable<T> Get(Expression<Func<T, bool>> expression);
        /// <summary>
        /// 删除一个实体
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
       void Delete(T t);
        /// <summary>
        /// 根据条件删除实体
        /// </summary>
        /// <param name="expression"></param>
        void Delete(Expression<Func<T, bool>> expression);
        /// <summary>
        /// 保存
        /// </summary>
        void Save();
    }
}
